﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.ComponentModel.DataAnnotations;
using HelloMinasan.Domain;

namespace HelloMinasan.Web.ViewModels
{
    public class UserMedicationModel
    {
        public UserMedicationModel()
        {
            UserMedicationSetting = PrivacySetting.Public;
            TimeTo = DateTime.UtcNow;
            TimeFrom = DateTime.UtcNow;
            IsPresent = true;
        }
        public int Id { get; set; }

        [Required(ErrorMessageResourceType = typeof(Resources.Resource), ErrorMessageResourceName = "DosageEmpty")]
        [StringLength(100, ErrorMessageResourceType = typeof(Resources.Resource), ErrorMessageResourceName = "InValidMaxSize")]
        [Display(Name = "Dosage")]
        public string TypeAndDossage { get; set; }

        [Required(ErrorMessageResourceType = typeof(Resources.Resource), ErrorMessageResourceName = "MedicationEmpty")]
        [StringLength(100, ErrorMessageResourceType = typeof(Resources.Resource), ErrorMessageResourceName = "InValidMaxSize")]
        public string Medication { get; set; }

        [Required(ErrorMessageResourceType = typeof(Resources.Resource), ErrorMessageResourceName = "RequiredObject")]
        public DateTime TimeFrom { get; set; }
        
        public DateTime? TimeTo { get; set; }

        public bool IsPresent { get; set; }

        public virtual DateTime LastUpdatedDate { get; set; }

        public PrivacySetting UserMedicationSetting { get; set; }
    }
}